package com.yyplatform.admin.platform.monitor.utils;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * Created on 2025-04-17
 */
public class IpUtils {
    public static String getHostName() {
        try {
            return InetAddress.getLocalHost().getHostName();
        } catch (UnknownHostException e) {
            // ignore
        }
        return "未知";
    }

    public static String getHostIp() {
        try {
            return InetAddress.getLocalHost().getHostAddress();
        } catch (UnknownHostException e) {
            // ignore
        }
        return "127.0.0.1";
    }

}
